from peewee import *

database = MySQLDatabase('mini', **{'charset': 'utf8', 'sql_mode': 'PIPES_AS_CONCAT', 'use_unicode': True, 'host': 'localhost', 'port': 3306, 'user': 'root', 'password': '123456'})

class UnknownField(object):
    def __init__(self, *_, **__): pass

class BaseModel(Model):
    class Meta:
        database = database

class MovieInfo(BaseModel):
    box_num = DecimalField(null=True)
    box_unit = CharField(null=True)
    movie_id = IntegerField(null=True)
    score_num = CharField(null=True)

    class Meta:
        table_name = 'movie_info'

class MovieList(BaseModel):
    actor = CharField(null=True)
    date = DateTimeField(null=True)
    movie_id = IntegerField(null=True, unique=True)
    name = CharField(null=True)
    score = FloatField(null=True)
    type = CharField(null=True)

    class Meta:
        table_name = 'movie_list'

class Tthread(BaseModel):
    thread_id = IntegerField(null=True)

    class Meta:
        table_name = 'tthread'

